//
//  OFPhotoCell.swift
//  OfferManager
//
//  Created by IT.Bear on 2018/1/4.
//  Copyright © 2018年 OFFER. All rights reserved.
//

import UIKit
import Kingfisher
import AlamofireImage

class OFPhotoCell: UICollectionViewCell {

    @IBOutlet weak var headImageView: UIImageView!
    
    class func caculateSize () -> CGSize{
        return CGSize(width:XXScreenWidth/2-1,height:200)
    }
    
    class func cellWithCollectionView (_ collectionView:UICollectionView,_ indexPath:IndexPath) -> UICollectionViewCell {
        collectionView.register(UINib.init(nibName: "OFPhotoCell", bundle:nil), forCellWithReuseIdentifier: "OFPhotoCell")
        let cell :UICollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: "OFPhotoCell", for: indexPath)
        return cell
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.headImageView.af_setImage(withURL: XXURL("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1515065910070&di=4239849f176e2cdde5b1cc1d5e754e39&imgtype=0&src=http%3A%2F%2Fimgsrc.baidu.com%2Fforum%2Fw%3D580%2Fsign%3D5e28e19e72094b36db921be593cd7c00%2F5739cd1b9d16fdfac0d4d9afb08f8c5495ee7b09.jpg") as URL)
    }

}
